import os
import sys
import re

if __name__ == '__main__':
    handler = sys.stdin
    word_dict = {}
    for line in handler:
        if not line:
            continue
        friend = line.strip().split(" ")
	#require all output and make keys
	host = line.strip().split(' ')[0]

        if host not in word_dict:
            #delete repeat friend
            friend_s=set()
            friend_s.add(friend[1])
            word_dict[host]=friend_s
        else:
            friend_s=word_dict[host]
            friend_s.add(friend[1])

    for j in word_dict:
        print(j, ':',word_dict[j])

